package com.campuscarbooking.api.dto.request;

import com.campuscarbooking.api.model.BusSchedule;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalTime;

@Data
@ApiModel(value = "班车请求对象", description = "创建或更新班车时的请求数据")
public class ScheduleRequest {
    @ApiModelProperty(value = "发车时间", example = "08:00", required = true, notes = "格式: HH:mm")
    @NotNull
    private LocalTime departureTime;

    @ApiModelProperty(value = "到达时间", example = "09:00", required = true, notes = "格式: HH:mm")
    @NotNull
    private LocalTime arrivalTime;

    @ApiModelProperty(value = "路线方向", example = "A_to_B", required = true, notes = "可选值: A_to_B, B_to_A")
    @NotNull
    private BusSchedule.RouteDirection routeDirection;

    @ApiModelProperty(value = "是否固定班车", example = "true", notes = "true: 固定班车, false: 临时班车")
    private Boolean isFixed = true;

    @ApiModelProperty(value = "座位容量", example = "40", required = true, notes = "必须大于0")
    @NotNull
    @Min(1)
    private Integer capacity;

    @ApiModelProperty(value = "票价", example = "5.00", required = true, notes = "必须大于等于0")
    @NotNull
    @Min(0)
    private BigDecimal price;

    @ApiModelProperty(value = "司机ID", example = "1", notes = "可选")
    private Long driverId;

    @ApiModelProperty(value = "备注", example = "临时加班车", notes = "可选")
    private String remark;
} 